import com.itheima.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @program: Spring_day01_01_IOC入门程序
 * @description: 静态工厂
 * @author: xuejingjing
 * @create: 2021-07-24 10:41
 **/
public class StaticFactory {
    public static void main(String[] args) {
        //加载spring容器
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        //对象交由spring创建
        UserService userService1 = (UserService)ac.getBean("userService4");

        System.out.println(userService1);

    }
}
